package org.rambadger.query.resource;

import com.yammer.metrics.annotation.Timed;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * Ping REST endpoint
 *
 * @author Chris Wash <a href="mailto:chris.wash@gmail.com">chris.wash@gmail.com</a>
 */
@Path("/resources")
@Produces(MediaType.APPLICATION_JSON)
public class PingResource {

    private final String replyText;

    public PingResource(String replyText) {
        this.replyText = replyText;
    }

    @GET
    @Timed
    public String ping() {
        return replyText;
    }
}
